home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / midas060 / src / mixsd.inc < prev    next >
Encoding:
Text File  |  1997-01-16  |  6.0 KB  |  198 lines

  1. ;*      MIXSD.INC
  2. ;*
  3. ;* Miscellaneous helper functions common to all mixing sound devices.
  4. ;* Technically these functions should be part of each Sound Device's internal
  5. ;* code, but are here to save some space and help maintenance.
  6. ;*
  7. ;* $Id: mixsd.inc,v 1.3 1997/01/16 18:41:59 pekangas Exp $
  8. ;*
  9. ;* Copyright 1996,1997 Housemarque Inc.
  10. ;*
  11. ;* This file is part of the MIDAS Sound System, and may only be
  12. ;* used, modified and distributed under the terms of the MIDAS
  13. ;* Sound System license, LICENSE.TXT. By continuing to use,
  14. ;* modify or distribute this file you indicate that you have
  15. ;* read the license and understand and accept it fully.
  16. ;*
  17.  
  18.  
  19.  
  20.  
  21. ;/***************************************************************************\
  22. ;*
  23. ;* Function:    int mixsdInit(unsigned mixRate, unsigned mode,
  24. ;*                  unsigned dmaChNum)
  25. ;*
  26. ;* Description: Common initialization for all mixing Sound Devices.
  27. ;*              Initializes DMA functions, DSM, start DMA playback and
  28. ;*              allocates memory for possible post-processing tables
  29. ;*
  30. ;* Input:       unsigned mixRate        mixing rate in Hz
  31. ;*              unsigned mode           output mode
  32. ;*              unsigned dmaChNum       DMA channel number
  33. ;*
  34. ;* Returns:     MIDAS error code
  35. ;*
  36. ;\***************************************************************************/
  37.  
  38. GLOBAL  LANG mixsdInit : _funct
  39.  
  40.  
  41.  
  42.  
  43. ;/***************************************************************************\
  44. ;*
  45. ;* Function:    int CALLING mixsdClose(void)
  46. ;*
  47. ;* Description: Common uninitialization code for all mixing Sound Devices.
  48. ;*              Uninitializes DMA playback and DSM and deallocates memory.
  49. ;*
  50. ;* Returns:     MIDAS error code
  51. ;*
  52. ;\***************************************************************************/
  53.  
  54. GLOBAL  LANG mixsdClose : _funct
  55.  
  56.  
  57.  
  58.  
  59. ;/***************************************************************************\
  60. ;*
  61. ;* Function:    int mixsdGetMode(unsigned *mode)
  62. ;*
  63. ;* Description: Reads the current output mode
  64. ;*
  65. ;* Input:       unsigned *mode          pointer to output mode
  66. ;*
  67. ;* Returns:     MIDAS error code. Output mode is written to *mode.
  68. ;*
  69. ;\***************************************************************************/
  70.  
  71. GLOBAL  LANG mixsdGetMode : _funct
  72.  
  73.  
  74.  
  75.  
  76. ;/***************************************************************************\
  77. ;*
  78. ;* Function:    int mixsdOpenChannels(unsigned channels)
  79. ;*
  80. ;* Description: Opens sound channels for output. Prepares post-processing
  81. ;*              tables, takes care of default amplification and finally opens
  82. ;*              DSM channels. Channels can be closed by simply calling
  83. ;*              dsmCloseChannels().
  84. ;*
  85. ;* Input:       unsigned channels       number of channels to open
  86. ;*
  87. ;* Returns:     MIDAS error code
  88. ;*
  89. ;\***************************************************************************/
  90.  
  91. GLOBAL  LANG mixsdOpenChannels : _funct
  92.  
  93.  
  94.  
  95.  
  96. ;/***************************************************************************\
  97. ;*
  98. ;* Function:    int mixsdSetAmplification(unsigned amplification)
  99. ;*
  100. ;* Description: Sets the amplification level. Calculates new post-processing
  101. ;*              tables and calls dsmSetAmplification() as necessary.
  102. ;*
  103. ;* Input:       unsigned amplification  amplification value
  104. ;*
  105. ;* Returns:     MIDAS error code
  106. ;*
  107. ;\***************************************************************************/
  108.  
  109. GLOBAL  LANG mixsdSetAmplification : _funct
  110.  
  111.  
  112.  
  113.  
  114. ;/***************************************************************************\
  115. ;*
  116. ;* Function:    int mixsdGetAmplification(unsigned *amplification);
  117. ;*
  118. ;* Description: Reads the current amplification level. (DSM doesn't
  119. ;*              necessarily know the actual amplification level if
  120. ;*              post-processing takes care of amplification)
  121. ;*
  122. ;* Input:       unsigned *amplification   pointer to amplification level
  123. ;*
  124. ;* Returns:     MIDAS error code. Amplification level is written to
  125. ;*              *amplification.
  126. ;*
  127. ;\***************************************************************************/
  128.  
  129. GLOBAL  LANG mixsdGetAmplification : _funct
  130.  
  131.  
  132.  
  133.  
  134. ;/***************************************************************************\
  135. ;*
  136. ;* Function:    int mixsdSetUpdRate(unsigned updRate);
  137. ;*
  138. ;* Description: Sets the channel value update rate (depends on song tempo)
  139. ;*
  140. ;* Input:       unsigned updRate        update rate in 100*Hz (eg. 50Hz
  141. ;*                                      becomes 5000).
  142. ;*
  143. ;* Returns:     MIDAS error code
  144. ;*
  145. ;\***************************************************************************/
  146.  
  147. GLOBAL  LANG mixsdSetUpdRate : _funct
  148.  
  149.  
  150.  
  151.  
  152. ;/***************************************************************************\
  153. ;*
  154. ;* Function:    int mixsdStartPlay(void)
  155. ;*
  156. ;* Description: Prepares for playing - reads DMA playing position. Called
  157. ;*              once before the Sound Device and music player polling loop.
  158. ;*
  159. ;* Returns:     MIDAS error code
  160. ;*
  161. ;\***************************************************************************/
  162.  
  163. GLOBAL  LANG mixsdStartPlay : _funct
  164.  
  165.  
  166.  
  167.  
  168. ;/***************************************************************************\
  169. ;*
  170. ;* Function:    int mixsdPlay(int *callMP);
  171. ;*
  172. ;* Description: Plays the sound - mixes the correct amount of data with DSM
  173. ;*              and copies it to DMA buffer with post-processing.
  174. ;*
  175. ;* Input:       int *callMP             pointer to music player calling flag
  176. ;*
  177. ;* Returns:     MIDAS error code. If enough data was mixed for one updating
  178. ;*              round and music player should be called, 1 is written to
  179. ;*              *callMP, otherwise 0 is written there. Note that if music
  180. ;*              player can be called, mixsdPlay() should be called again
  181. ;*              with a new check for music playing to ensure the DMA buffer
  182. ;*              gets filled with new data.
  183. ;*
  184. ;\***************************************************************************/
  185.  
  186. GLOBAL  LANG mixsdPlay : _funct
  187.  
  188.  
  189. ;* $Log: mixsd.inc,v $
  190. ;* Revision 1.3  1997/01/16 18:41:59  pekangas
  191. ;* Changed copyright messages to Housemarque
  192. ;*
  193. ;* Revision 1.2  1996/05/30 22:38:46  pekangas
  194. ;* no changes?
  195. ;*
  196. ;* Revision 1.1  1996/05/22 20:49:33  pekangas
  197. ;* Initial revision
  198. ;*